from rest_framework.pagination import PageNumberPagination


class CustomPagination(PageNumberPagination):
    page_size = 5  # 每页 5 条记录
    page_query_param = 'page'
    page_query_description = '页码'
    page_size_query_param = 'limit'  # 客户端可以通过此参数改变每页数量
    page_size_query_description = '每页的结果数'
    max_page_size = 100  # 最大每页数量